package main

import (
	"fmt"
	"go.uber.org/zap"
	"google.golang.org/grpc"
	"net"
	"user_srv/global"
	_ "user_srv/initialize"
	"user_srv/logic"
	"user_srv/proto"
)

func main() {
	g := grpc.NewServer()
	proto.RegisterUserServer(g, &logic.Server{})
	listen, err := net.Listen("tcp", fmt.Sprintf("%s:%d", global.ServerConfig.IP, global.ServerConfig.Port))
	if err != nil {
		zap.S().Panic(err)
	}
	err = g.Serve(listen)
	if err != nil {
		zap.S().Panic(err)
	}
}
